package com.dc.modules.sys.user.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.dc.commons.persistence.BaseEntity;

/*******************************************************************************<P>
 * 文件名: DcSysUserRole.java <br>
 * 版本: 1.0<br>
 * 描述:<br>
 * 版权所有: <br>
 * <P>
 * 创建者: 王建栋 <br>
 * 创建日期: 2016年6月3日 下午7:07:54<br>
 * 修改者: <br>
 * 修改日期: <br>
 * 修改说明: <br>
 ******************************************************************************/
@Entity
@Table(name="DC_SYS_USER_ROLE")
public class DcSysUserRole extends BaseEntity{

	private String userKey;
	private String roleKey;
	
	private DcSysUser sysUser;
	private DcSysRole sysRole;
	
	
	@ManyToOne(fetch=FetchType.EAGER)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="USER_KEY",insertable=false,updatable=false)
	public DcSysUser getSysUser() {
		return sysUser;
	}
	public void setSysUser(DcSysUser sysUser) {
		this.sysUser = sysUser;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="ROLE_KEY",insertable=false,updatable=false)
	public DcSysRole getSysRole() {
		return sysRole;
	}
	public void setSysRole(DcSysRole sysRole) {
		this.sysRole = sysRole;
	}
	@Column(name="USER_KEY",length=50)
	public String getUserKey() {
		return userKey;
	}
	public void setUserKey(String userKey) {
		this.userKey = userKey;
	}
	@Column(name="ROLE_KEY",length=50)
	public String getRoleKey() {
		return roleKey;
	}
	public void setRoleKey(String roleKey) {
		this.roleKey = roleKey;
	}
	
	
	
}
